<?php
namespace app\super\controller;
use think\Controller;
use think\Db;
class PopupController extends  Controller {

    public function getPopup(){
        $where['status'] =1;
        $res = Db::table('up_popup')->where($where)->find();
        if($res['popup']){
            Db::table('up_popup')->where('popup',$res['popup'])->setField('status',2);
            $returnData['status'] = 1;
            $returnData['type'] = $res['type'];
            return json_encode($returnData);
        }else{
            $returnData['status'] = 0;
            return json_encode($returnData);
        }
    }
}